<template>
  <!--顶部通栏-->
  <AppTopnav/>

  <!--  头部组件和吸顶头部组件显示其一-->
  <!--  吸顶头部组件-->
  <AppHeaderSticky/>
  <!-- 头部组件-->
  <AppHeader/>

  <!--  内容容器-->
  <div class="app-body">
    <!--  二级路由-->
    <RouterView/>
  </div>
  <!--  底部组件-->
  <AppFooter/>
</template>

<script>
import AppTopnav from '@/components/app-topnav'
import AppHeader from '@/components/app-header'
import AppFooter from '@/components/app-footer'
import { useStore } from 'vuex'
import AppHeaderSticky from '@/components/app-header-sticky'

export default {
  name: 'LayoutPage',
  components: {
    AppHeaderSticky,
    AppFooter,
    AppHeader,
    AppTopnav
  },
  // 获取分类数据
  setup () {
    const store = useStore()
    // store的action中用dispatch获取数据
    store.dispatch('category/getList')
  }
}
</script>

<style lang="less" scoped>
.app-body {
  min-height: 600px;
}
</style>
